package com.wc.vo;

import com.wc.domain.Admin;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * @author hc
 * @date 2022/4/9 11:43
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
public class AdminVO {
    private Integer id;
    private String nickname;
    private String account;
    private String avatar;


    public static AdminVO admin2AdminVO(Admin admin) {
        if (admin == null) {
            return null;
        }
        AdminVO adminVO = new AdminVO();
        adminVO.setId(admin.getId());
        adminVO.setNickname(admin.getNickname());
        adminVO.setAccount(admin.getAccount());
        adminVO.setAvatar(admin.getAvatar());

        return adminVO;
    }
}
